// https://iai.sh.cn/problem/718
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  cout << int(sqrt(2 * n + 0.25) - 0.5);
  return 0;
}